


<div class="container">

    <style>
        *{margin:0;padding:0;box-sizing: border-box;}
        body{
            background: #eaecf1;
            color: #000;
            font-size: 12px;
            font-family: "SimHei"
        }
        .container{
            width: 730px;
            margin: 0px auto;
            background: #fff;
            padding: 30px 0;
            position: relative;
            padding-left: 10px;

        }
        .center{
            text-align: center;
        }
        .left{
            text-align: left;
        }
        .right{text-align: right;}
        .inline{
            display: table;
            width: 100%;
            padding: 5px 0;
        }
        .inline>li{
            display: table-cell;
        }
        h2{
            font-size: 30px;
        }
        h3{
            font-size: 24px;
            position: absolute;
            width: 100%;
            padding-left: 40%;
        }
        h4{
            font-size: 18px;
        }
        table{
            margin: 10px 0;
        }
        table td,table th{
            text-align: center;
            line-height: 30px;
            font-size: 12px;
        }
        table th:last-child{
            width: 100px;
        }
        table td{
            text-align: center;
            line-height: 24px;
        }
        .red{color:red;}
        .green{color:green;}

        #btn_print {
            width: 71px;
            height: 24px;
            background-image: url(/Public/Home/images/btn_print.gif);
            cursor: pointer;
            margin-left: auto;
            margin-right: auto;
        }
        #print_confirm {
            width: 100%;
            height: 30px;
            border-top: 1px solid #999999;
            padding-top: 4px;
            background-color: #5473ae;
            position: absolute;
        }

    </style>


    <h2 class="center">{$printing['printing']['local_name']}</h2>
    <h3>发货单</h3>
    <ul class="inline">
        <li width="50%;"><h4 class="red">配送方式：{$printing['detail']['shipping']}</h4></li>
       <!-- <li class="right"><h4 class="red">付款方式：{$printing['detail']['payment']}</h4></li>-->
        <li class="right"><h4 class="red">投筐编号：</h4></li>
    </ul>
    <ul class="inline">
        <li id="o_id" data-id="{$printing['detail']['order_id']}">订单号：{$printing['detail']['order_id']}</li>
        <li>客户ID：{$printing['printing']['member_name']}</li>
        <li>收货人：{$printing['detail']['ship_name']}</li>
        <if condition="$printing['detail']['shipping_id'] eq 3">
            <li>自提点：{$printing['detail']['zT_addr']}</li>
           <else/>
            <li>收货地址：{$printing['detail']['ship_area']}{$printing['detail']['ship_addr']}</li>
         </if>
        <if condition="$printing['detail']['is_zt'] eq 1">

            <li>自提电话：{$printing['detail']['pickedup_bn']}</li>
            <else/>
            <li>联系电话：{$printing['detail']['ship_mobile']}</li>
         </if>
    </ul>
    <table cellspacing="0" cellpadding="0" border="1" width="100%;">
        <tbody><tr>
            <th>商品条码/编码</th>
            <th>商品名称</th>

            <th>单价</th>
            <th>规格</th>
            <th>单位</th>
            <th width="30">订单数量</th>
            <!--<th width="30">发货数量</th>-->
            <th>订单金额</th>
            <!--<th><span class="green">实发金额</span></th>-->
            <th>备注</th>
        </tr>
    <volist  name="printing['product']" id="goodsItem">
        <tr>
            <td>{$goodsItem['barcode']}</td>
            <td>{$goodsItem['name']}</td>

            <td>￥{$goodsItem['price']|number_format=###, 2, '.', ''}</td>
            <td>{$goodsItem['spec_info']}</td>
            <td>{$goodsItem['unit']}</td>
            <td>{$goodsItem['nums']}</td>
            <!--<td>0</td>-->
            <td>￥{$goodsItem['amount']|number_format=###, 2, '.', ''}</td>
            <!--<td><span class="green">￥0.00</span></td>-->
            <td></td>
        </tr>
    </volist>
        <tr>
            <td>运费</td>
            <td></td>
            <td> </td>
            <td></td>
            <td></td>
            <td></td>
            <!--<td></td>-->
            <td>￥{$printing['detail']['cost_freight']|number_format=###, 2, '.', ''}</td>
            <!--<td></td>-->
            <td></td>
        </tr>
        <tr>
            <td>订单优惠</td>
            <td></td>
            <td> </td>
            <td></td>
            <td></td>
            <td></td>
            <!--<td></td>-->
            <td>￥{$printing['youhui']|number_format=###, 2, '.', ''}</td>
            <!--<td></td>-->
            <td></td>
        </tr>
        <tr>
            <td>合计</td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <!--<td></td>-->
            <td>￥{$printing['detail']['total_amount']|number_format=###, 2, '.', ''}</td>
            <!--<td><span class="green">￥0.00</span></td>-->
            <td></td>
        </tr>
        <tr>
            <td colspan="8" style="text-align:left;padding-left:36px;">客户备注：</td>
            <!--<td></td>

            <!--<td></td>
            <!--<td></td>
            <!--<td></td>
            <!--<td></td>
            <!--<td></td>
            <!--<td><span class="red">￥49.60</span></td>
            <td></td>-->
        </tr>
        </tbody></table>
    <ul class="inline center">
        <li style="text-align: left;width: 25%;">订单时间：{$printing['detail']['createtime']}</li>
        <li>配送员签字：</li>
        <li>收货人签字：</li>
    </ul>

</div>



<div id="print_confirm" class="noprint" style="top: 650px;"><div id="btn_print"></div></div>
<script src="__PUBLIC__/Home/js/jquery.min.js"></script>
<script src="__PUBLIC__/Home/js/jquery.PrintArea.min.js"></script>
<script>
    $("#btn_print").click(function(){
        $(".container").printArea();
        $.ajax({
            url:'/Admin/Orders/printChangeColor',
            dataType:'json',
            data:{'order_id':$('#o_id').data('id')},
            success:function (data) {
                if(data.status != 1){
                    popup.alertPopup('打印发货单状态更改失败！');
                }
            },
            error:function () {
                popup.alertPopup('网络异常，请稍候再试');
            }

        })




    });

</script>